package com.example.weworkfinancesdk;

import com.tencent.wework.Finance;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class WeworkFinanceSdkApplication {

    public static void main(String[] args){
        SpringApplication.run(WeworkFinanceSdkApplication.class, args);

        long sdk = Finance.INSTANCE.NewSdk();
        System.out.println(Finance.INSTANCE.Init(sdk, "wwd08c8e7c775ab44d", "zJ6k0naVVQ--gt9PUSSEvs03zW_nlDVmjLCTOTAfrew"));
        Finance.Slice_t slice = Finance.INSTANCE.NewSlice();
        long ret = Finance.INSTANCE.GetChatData(sdk, 0, 10, "", "", 1000L, slice);
        if (ret != 0) {
            System.out.println("getchatdata ret " + ret);
            return;
        }
        System.out.println("getchatdata :" + Finance.INSTANCE.GetContentFromSlice(slice));
        Finance.INSTANCE.FreeSlice(slice);
        Finance.INSTANCE.DestroySdk(sdk);
    }
}
